﻿using System;
using RpcModel;
using SqlExecHelper;
using Wedonek.RpcStore.Service.Helper;
using Wedonek.RpcStore.Service.Model;

namespace Wedonek.RpcStore.Service.DAL
{
    internal class ResourceDAL : SqlBasicClass
    {
        public ResourceDAL() : base("ResourceList", "RpcExtendService")
        {

        }

        public ResourceData Get(Guid id)
        {
            return base.GetRow<Guid, ResourceData>("Id", id);
        }
        public ResourceData[] Query(ResourceQueryParam query, IBasicPage paging, out long count)
        {
            paging.InitOrderBy("Id", true);
            return base.Query<ResourceData>(paging.OrderBy, paging.Index, paging.Size, out count, query.ToWhere());
        }
    }
}
